<?php get_header(); ?>
<!-- Slideshow begin -->
<div class="content">
<!-- Slideshow begin -->
<?php include (TEMPLATEPATH . '/slideshow.php'); ?>
<!-- Slideshow end -->
<!-- Featured Begin-->
<div class="featured">
    <!-- Introduction begin -->
    <div class="section introduction">
        <h2>
            <a href="<?php if ( get_option('wpyou_aboutus_url') ) { ?><?php echo stripslashes(get_option('wpyou_aboutus_url')); ?><?php } else { ?>#<?php } ?>">企业简介</a>
            <em><a href="<?php if ( get_option('wpyou_aboutus_url') ) { ?><?php echo stripslashes(get_option('wpyou_aboutus_url')); ?><?php } else { ?>#<?php } ?>">更多››</a></em>
        </h2>
        <div class="introduce">
            <?php if ( get_option('wpyou_aboutus') ) { ?>
                <?php echo stripslashes(get_option('wpyou_aboutus')); ?>
            <?php } else { ?>
                请在后台的【 外观 - 当前主题设置 】中添加 企业简介 的内容
            <?php } ?>
            <div class="clearfix"></div>
        </div>
    </div>
    <!-- Introduction end -->
	<!-- News begin -->
    <div class="section news">
        <h2>
            <?php if (get_option('wpyou_news_id')) { $newsid = get_option('wpyou_news_id'); ?>
                <a href="<?php echo get_category_link( $newsid );?>" title="<?php echo get_cat_name( $newsid ); ?>"><?php echo get_cat_name( $newsid ); ?></a>
            <?php } else { ?>
                 <a href="<?php bloginfo('siteurl');?>/category/news">新闻动态</a>
            <?php } ?>
            <em><?php if (get_option('wpyou_news_id')) { $newsid = get_option('wpyou_news_id'); ?>
                <a href="<?php echo get_category_link( $newsid );?>" title="<?php echo get_cat_name( $newsid ); ?>">更多››</a>
            <?php } else { ?>
                 <a href="<?php bloginfo('siteurl');?>/category/news">更多››</a>
            <?php } ?></em>
        </h2>
        <?php if (get_option('wpyou_news_id')) { $newsid = get_option('wpyou_news_id'); ?>
            <?php query_posts('caller_get_posts=1&showposts=10&cat='.$newsid); ?>
        <?php } else { ?>
            <?php query_posts('caller_get_posts=1&showposts=10&cat=news'); ?>
        <?php } ?>
        <ul>
        	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
             <li><a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title() ?></a><span><?php the_time('Y-m-d') ?></span></li>
        	<?php endwhile; endif; ?>
        </ul>
    </div>
    <!-- News end -->
    <!-- Products begin -->
    <div class="section products">
        <h2>
        	<a href="<?php if ( get_option('wpyou_new_products') ) { ?><?php echo stripslashes(get_option('wpyou_new_products')); ?><?php } else { ?>#<?php } ?>">业绩展示</a>
            <em><a href="<?php if ( get_option('wpyou_new_products') ) { ?><?php echo stripslashes(get_option('wpyou_new_products')); ?><?php } else { ?>#<?php } ?>">更多››</a></em>
        </h2>
        <?php if (get_option('wpyou_products_id')) { $productsid = get_option('wpyou_products_id'); } ?>
        <?php query_posts('caller_get_posts=1&showposts=6&cat='.$productsid); ?>
            <div class="scroll">
            <ul>
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                 <li>
                    <?php if ( get_post_meta($post->ID, 'thumbnail', true) ) { ?>  
                        <?php $thumbnail = get_post_meta($post->ID, 'thumbnail', true); ?>
                            <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><img src="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /> </a>  
                    <?php
                         } elseif ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) {
                    ?>
                            <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" ><img src="<?php $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 215,165 ), false); echo $thumbnail[0]; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /></a>
                    <?php } else {?>
                            <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" ><img src="<?php echo catch_post_image(); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /></a>
                    <?php } ?>
                    <h4><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="a_product"><?php the_title() ?></a></h4>
                 </li>
            <?php endwhile; endif; ?>
            </ul>
            </div>
            <div class="clearfix"></div>
            <div class="clearfix"></div>
    </div>
    <!-- Products end -->
</div>
<!-- Featured end-->
</div>
<!-- Featured end-->
<!-- Sidebar Begin-->
<?php include (TEMPLATEPATH . '/sidebar_home.php'); ?>
<!-- Sidebar end-->
<?php get_footer(); ?>